package com.cyou.qb.system;

import com.cyou.qb.common.domain.QiangbaAdmin;

/**
 * 抢吧后台登录用户上下文
 * @author luzhaoman
 *
 */
public class AdminUserContext extends QiangbaAdmin implements UserContext{
	
	/** */
	private String userIP;
	
	private String systemName;
	
	@Override
	public int getUserId() {
		return getAdminId();
	}
	
	public String getUserIp() {
		return userIP;
	}
	public void setUserIP(String userIP) {
		this.userIP = userIP;
	}
	public String getSystemName() {
		return systemName;
	}
	public void setSystemName(String systemName) {
		this.systemName = systemName;
	}
	
	public static UserContext getDefault() {
		AdminUserContext ret = new AdminUserContext();
		ret.setSystemName("qiangba_admin");
		ret.setUserIP(SpringMvcUtils.getRequest().getRemoteAddr());
		ret.setAdminId(-1);
		return ret;
	}
	public static UserContext getDefault4Task() {
		AdminUserContext ret = new AdminUserContext();
		ret.setSystemName("qiangba_task");
		ret.setUserIP("-1");
		ret.setAdminId(-1);
		return ret;
	}
}
